﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Northwind.NET.FE.Forms
{
    public partial class CustomerPhoneList : Form
    {
        public CustomerPhoneList()
        {
            InitializeComponent();
        }

        private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.customerBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.dataModelDataSet);
        }

        private void Customer_Phone_List_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dataModelDataSet.Customer' table. You can move, or remove it, as needed.
            this.customerTableAdapter.Fill(this.dataModelDataSet.Customer);


        }

        private void customerDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void letterbutton_Click(object sender, EventArgs e)
        {
            Button button = (Button)sender;
            string filter = string.Format("Name LIKE '{0}*'", button.Tag);  
            this.customerBindingSource.Filter = filter;
        }

    }
}
